class LinkNode{
     int val ;
     LinkNode next;
     LinkNode prev;

    public LinkNode(int val, LinkNode next, LinkNode prev) {
        this.val = val;
        this.next = next;
        this.prev = prev;
    }

    public LinkNode() {
    }
}
class MyLinkedList extends LinkNode{
    private LinkNode head;
    private LinkNode last;


    public void clear(){
        LinkNode cur = head;
        while (cur != null){
            LinkNode curNext = cur.next;
            cur.next = null;
            cur.prev = null;
            cur = curNext;
        }
        head = null;
        last = null;
    }

}